package com.lkm.app_ui.m.Imple.system_camera;

import android.Manifest;

import com.lkm.app_ui.m.camera.CameraModule;
import com.lkm.frame.module.ConditionConfige;
import com.lkm.frame.module.ModuleDelegate;
import com.lkm.frame.module.ModuleManager;
import com.lkm.frame.module.PermissionCondition;



public class SystemCameraModuleDelegate implements ModuleDelegate<CameraModule,Void> {
    @Override
    public void init(ModuleManager moduleManager) {

    }

    @Override
    public void dependency(DependencyConfig dc) {

    }

    @Override
    public void configure(ConditionConfige<Void> cc) {

        cc.setPermissCondition(new PermissionCondition() {
            @Override
            public String[] initMissPermission() {
                return new String[]{Manifest.permission.CAMERA};
            }

            @Override
            public String[] initRunPermission() {
                return new String[0];
            }

            @Override
            public boolean isLazyRequestPermission() {
                return false;
            }
        });

    }

    @Override
    public CameraModule execute(Void aVoid) {
        return new SystemCameraModuleImple();
    }

    @Override
    public Class<CameraModule> getModuleInterfaceClass() {
        return CameraModule.class;
    }

    @Override
    public void onError(ErrorWarp e) {

    }
}
